/**
 * Created by jianhuang on 2015/1/9.
 */
define(['jquery','underscore','template','helper/utils'],
    function ($,_,template,Utils) {
        function IndexPage() {
            this.testBtn=$("#testBtn");
        }

        IndexPage.prototype.bindEvent=function(){
            var t=this;
            var url=URL+"/test";
            var data={name:"wong",age:28};
            t.testBtn.on("click",function(){
                Utils.send("post",url,data,function(data){
                    console.log(data);
                });
            });

        };

        IndexPage.prototype.renderPage=function(){
            var t=this;

        };

        IndexPage.prototype.templatePage=function(){
            var data={"msg":"hello world template"};
            var res=template("templateMsg",data);
            Utils.trace(res);
        };

        IndexPage.prototype._init = function () {
            var t = this;
            this.renderPage();
            this.bindEvent();
        };

        IndexPage.prototype.render = function () {
            this._init();
        };

        return IndexPage;
    }
);